<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::group(['prefix' => 'product'], function() {
    Route::get('/', 'ProductController@index');
    Route::any('info/{id?}','ProductController@getInfo');
    Route::any('store/{id?}', 'ProductController@store');
    Route::any('delete', 'ProductController@doDelete');
    Route::any('addparts/{id?}','ProductController@addparts');
    Route::any('setparts/{id?}','ProductController@setparts');
    Route::any('deleteparts/{id?}','ProductController@deleteparts');
});

Route::group(['prefix' => 'storehouse'], function() {
    Route::get('/', 'StoreHouseController@index');
    Route::any('info/{id?}','StoreHouseController@getInfo');
    Route::any('store/{id?}', 'StoreHouseController@store');
    Route::any('delete', 'StoreHouseController@doDelete');
});

Route::group(['prefix' => 'parts'], function() {
    Route::get('/', 'PartsController@index');
    Route::any('info/{id?}','PartsController@getInfo');
    Route::any('store/{id?}', 'PartsController@store');
    Route::any('delete', 'PartsController@doDelete');
});

Route::group(['prefix' => 'batch'], function() {
    Route::get('/', 'BatchController@index');
    Route::any('addparts/{id?}','BatchController@addparts');
    Route::any('info/{id?}','BatchController@getInfo');
    Route::any('store/{id?}', 'BatchController@store');
    Route::any('delete', 'BatchController@doDelete');
    Route::any('setparts/{id?}','BatchController@setparts');
    Route::any('addparts/{id?}','BatchController@addparts');
    Route::any('deleteparts/{id?}','BatchController@deleteparts');
});

/*Route::group(['prefix' => 'moudule'], function() {
    Route::get('/', 'MouduleController@index');   //权限管理
    Route::any('store/{id?}', 'MouduleController@store');  //添加权限
    Route::any('moudule-info/{id}', 'MouduleController@getMouduleInfo'); //编辑信息
    Route::post('delete','MouduleController@doDelete');  //删除信息
});*/
